#ifndef _UART_H_
#define _UART_H_

typedef void (*read_func_ptr)(char *data, int len);

typedef struct
{
    int uart_fd;
    read_func_ptr func_call_read;
} UART_T;

extern int uart_open(char *com_port, UART_T *uart_t);
extern void uart_set(int nSpeed, int nBits, char nEvent, int nStop, UART_T *uart_t);
extern void uart_read_register(read_func_ptr read_call, UART_T *uart_t);
extern void uart_read_event_start(UART_T *uart_t);
extern int uart_send(UART_T *uart_t, char *data, int len);

#endif